<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

      /*   let num = "aaa";
        let obj = {
            "uname":'sdfds',
            "age":18,
            [num]:"nan"
        }

        console.log(obj); */

        let _data = {
            
           
        }

        Object.defineProperty(_data,"uname",{
            get(){
                console.log("有人读取我了 uname")
                return "张三"
            },
            set(){
                console.log("我uname 被改变了，vue并重新渲染视图");
            }
        })

        Object.defineProperty(_data,"age",{
            get(){
                console.log("有人读取我了age")
                return 30
            },
            set(){
                console.log("我 age 被改变了，vue并重新渲染视图");
            }
        })

        






    </script>
</body>
</html>